package com.tutu.commons.config;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

/**
 * @Program: b2c-cloud-store
 * @Description: MybatisPlus字段填充配置类
 * @Author: JK.TuTu
 * @Version: 1.0
 * @Create: 2022-12-27 22:20
 **/
@Component
public class FiledInsertConfig implements MetaObjectHandler {

    @Override
    public void insertFill(MetaObject metaObject) {
        metaObject.setValue("orderTime", System.currentTimeMillis());

    }

    @Override
    public void updateFill(MetaObject metaObject) {
        metaObject.setValue("orderTime", System.currentTimeMillis());
    }
}
